package com.zmj.controller;

import com.zmj.common.response.ServerResponse;
import com.zmj.service.RpcTestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 *
 * @author zhangmj
 * @date 2019/4/3 11:25
 */
@RequestMapping("test")
@RestController
public class RpcTestController {

    @Autowired
    RpcTestService rpcTestService;

    /**
     * 打招呼方法
     * @param name
     * @return
     */
    @GetMapping("/hello")
    public ServerResponse test(@RequestParam("name") String name){
        return rpcTestService.hello(name);
    }


    @GetMapping("/getInfo")
    public ServerResponse getInfo(@RequestParam("code") Integer code){
        return rpcTestService.getInfo(code);
    }
}
